The present invention relates to a method for managing a database, and more particularly, to a method and system for managing a database, which is capable of updating data stored in the database with high efficiency.
A database management system (hereinafter, referred to as “DBMS”) is provided to manage a database with large amounts of data. Such a database management system is essential in recent environments where there are large amounts of new information that is created continuously.
The DBMS stores data in type of table in the database, wherein the database table is a basic architecture for storing the data in the database. One database table is comprised of one or more records. At this time, the record indicates one row in the database table. Each record is comprised of one or more columns, wherein the column indicates a domain with a name expressing a table item in a real world for the database table, for example, which can be referred to as an attribute or field.
When a specific query is input to the DBMS, the DBMS performs functions of selecting, inserting, updating and deleting the data in the database according to the input query. In this case, the query indicates a specific request for the data stored in the table of database, that is, the query shows an operation required for the data. The query is expressed as a language such as SQL (Structured Query Language).
The most typical query in the SQLs is “SELECT”. Through the use of SELECT query, the data in the table can be obtained. Also, when the data is separately stored in the several tables, the desired data in the specific table can be obtained with reference to the data stored in the other tables.
For example, in case of the SQL syntax such as “SELECT content FROM board WHERE id=10”, it indicates the request for selecting the record which satisfies “id=10” from the table “board”.
If the DBMS is used for a bulletin board service, especially, a specific content is selected by a user, the DBMS receives a query from a bulletin board service providing server, wherein the query includes “SELECT” language for the request of the corresponding content and “UPDATE” language for the request of click-count increment of the corresponding content. According to the received query, the DBMS selects the corresponding content, and updates the click count of the selected content.
On provision of the specific content selected by a user in the system according to the prior art, even though selecting the corresponding content should be necessarily accompanied with the increment of click count, the two procedures are performed by the separate queries, thereby lowering the system efficiency.
However, when the update of record included in the specific table is performed in the prior art DBMS, the corresponding record is locked until when completing a transaction for the update of the corresponding record. Thus, it is impossible to perform the procedures of SELECT query and UPDATE query at the same time, thereby deteriorating simultaneity in use of the database.
In the prior art DBMS, when performing the update of record included in the specific table, the update result is reflected on the table every time the update is performed, whereby the system efficiency deteriorates with increasing counts of updates.